<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> 航空公司数据</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="common_css"/>
    <!-- Data Tables -->
    <link href="__PUBLIC__/admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <style>
        .page{width:80%;height:30px;margin:auto;margin-top:30px;}
        .page a{padding:8px;border:1px solid #CCC;}
        .page a:hover{color:#7C1B00;border:1px solid darkred;}
        .page span{padding:8px;border:1px solid #1A3E4A;margin:0px 5px;}
        /*td,th{text-align: center;}*/

        .fa-search-plus,.fa-trash{font-size: 18px;}
    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>航空公司数据</h5>
                        <!--<div class="ibox-tools">-->
                            <!--<a class="collapse-link">-->
                                <!--<i class="fa fa-chevron-up"></i>-->
                            <!--</a>-->
                            <!--<a class="dropdown-toggle" data-toggle="dropdown" href="table_data_tables.html#">-->
                                <!--<i class="fa fa-wrench"></i>-->
                            <!--</a>-->
                            <!--<ul class="dropdown-menu dropdown-user">-->
                                <!--<li><a href="table_data_tables.html#">选项1</a>-->
                                <!--</li>-->
                                <!--<li><a href="table_data_tables.html#">选项2</a>-->
                                <!--</li>-->
                            <!--</ul>-->
                            <!--<a class="close-link">-->
                                <!--<i class="fa fa-times"></i>-->
                            <!--</a>-->
                        <!--</div>-->
                    </div>

                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-sm-1 m-b-xs">
                                <a onclick="layerFrame('航空数据-添加','__MODULE__/Index/addAeronauticalView',900,600)" class="btn btn-w-m btn-success">添加</a>
                            </div>
                        </div>
                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>航空名称</th>
                                    <th>代码</th>
                                    <th>地区</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <volist name="list" id="vo">
                                <tr class="gradeX">
                                    <td>{$vo.id}</td>
                                    <td>{$vo.name}</td>
                                    <td>{$vo.code}</td>
                                    <td>{$vo.address}</td>
                                    <td><if condition="$vo.status eq 1"><span style="color:green;">已上线</span><else/><span style="color:red;">未上线</span></if></td>
                                    <td>
                                        <a onclick="layerFrame('编辑','__MODULE__/Index/updateAeronauticalView/id/{$vo.id}',900,600);"><i class="fa fa-search-plus text-navy"></i></a>
                                        <a onclick="deleteData('{$vo.id}')"><i class="fa fa-trash text-navy"></i></a>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                            <!--<tfoot>-->
                                <!--<tr>-->
                                    <!--<th>渲染引擎</th>-->
                                    <!--<th>浏览器</th>-->
                                    <!--<th>平台</th>-->
                                    <!--<th>引擎版本</th>-->
                                    <!--<th>CSS等级</th>-->
                                <!--</tr>-->
                            <!--</tfoot>-->
                        </table>
                        <div class="page">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 全局js -->
    <include file="common_js"/>
    <!-- Data Tables -->
    <script src="__PUBLIC__/admin/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="__PUBLIC__/admin/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <!-- 自定义js -->
    <script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
    <!-- Page-Level Scripts -->
    <script src="__PUBLIC__/common/js/layer_show.js"></script>
    <script>
        $(document).ready(function () {
            //$('.dataTables-example').dataTable();
        });

        function layerFrame(title,url,w,h) {
            layer_show(title,url,w,h);
        }

        function deleteData(id){
            var index = layer.load();
            $.ajax({
                type:"POST",
                url:"__URL__/getBalance",
                dataType:'json',
                data:{id:id},
                success:function(data){
                    //console.log(data);
                    //alert(JSON.stringify(data));return;
                    layer.close(index);
                    if(data.status==1){
                        layer.msg(data.msg,{icon: 1, time: 1000});
                        setTimeout(function () {location.reload();},1000);
                    }else{
                        layer.msg(data.msg,{icon: 2, time: 2000});
                    }
                },error:function(err){
//                    console.log(err);
                    layer.close(index);
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            });
        }
    </script>
</body>
</html>
